<template>
	<view :class="enable ? 'c-btn' : 'c-btn-unable'" @click="clickc">
		<image class="icon" :src="icon" mode=""></image>
	</view>
</template>

<script>
	export default {
		name:"c-btn",
		props: {
			icon: {
				type: String,
				default: ''
			},
			enable: {
				type: Boolean,
				default: true
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			
			clickc() {
				if (this.enable)
				this.$emit('click')
			}
		}
	}
</script>

<style scoped>
	
	.c-btn-unable {
		width: 30px;
		height: 30px;
		/* background-color: orange; */
		display: flex;
		align-items: center;
		justify-content: center;
		opacity: 0.5;
	}
	
	.c-btn {
		width: 30px;
		height: 30px;
		/* background-color: orange; */
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.c-btn:hover {
		cursor: pointer;
		opacity: 0.8;
	}
	
	.c-btn:active {
		opacity: 0.6;
	}
	
	.icon {
		width: 90%;
		height: 90%;
	}
	
</style>